<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <style>
    .container {
      width: 450px;
      border: 3px solid black;
      margin: 30px;
      position: relative;
    }

    .btns {
      display: flex;
      justify-content: flex-start;
      padding: 10px;
      border-top: 1px solid black;
    }

    .btns > div {
      margin: 10px;
    }
    .btns > div.active {
      border: 1px solid red;
    }

    .show {
      position: relative;
      user-select: none;
    }

    .mask {
      width: 200px;
      height: 200px;
      background-color: orange;
      opacity: 0.4;
      position: absolute;
      top: 0;
      left: 0;
    }

    .enlarge {
      width: 355px;
      height: 355px;
      position: absolute;
      left: 110%;
      top: 0;
      background: url('./imgs/1.big.jpg');
    }
    
  </style>
</head>
<body>
  <div class="container">
    <div class="show">
      <img src="./imgs/1.jpg" alt="middle">
      <div class="mask"></div>
    </div>
    <div class="btns">
      <div class="active">
        <img src="./imgs/1.small.jpg" alt="">
      </div>
      <div>
        <img src="./imgs/2.small.jpg" alt="">
      </div>
    </div>
    <div class="enlarge"></div>
  </div>
</body>
</html>
<script type="module">

import Box from './放大镜.js'

new Box('.container')

</script>